import tornado.httpserver 
import tornado.ioloop 
import tornado.web 
import sys

class MainHandler(tornado.web.RequestHandler): 
    def get(self): 
        self.write("Hello, world") 
application = tornado.web.Application([(r"/", MainHandler),]) 
if __name__ == "__main__": 
    argv = sys.argv
    http_server = tornado.httpserver.HTTPServer(application) 
    http_server.listen(int(argv[1]))
    tornado.ioloop.IOLoop.instance().start() 